package cn.ucai.timeindex;
import java.time.temporal.ChronoUnit;
import java.time.LocalDate;
import java.time.ZoneOffset;
import java.time.zone.*;
import com.kingboy.common.utils.date.LocalDateTimeUtils;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

import static com.kingboy.common.utils.date.LocalDateTimeUtils.getDayEnd;
import static com.kingboy.common.utils.date.LocalDateTimeUtils.getDayStart;

public class Epochtime {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		LocalDateTime start = LocalDateTime.of(1970, 1, 1, 0 , 0,0);
        LocalDateTime end = LocalDateTime.of(2018,2,2, 24-8, 18, 29);
        System.out.println("年:" + LocalDateTimeUtils.betweenTwoTime(start, end, ChronoUnit.YEARS));
        System.out.println("月:" + LocalDateTimeUtils.betweenTwoTime(start, end, ChronoUnit.MONTHS));
        System.out.println("日:" + LocalDateTimeUtils.betweenTwoTime(start, end, ChronoUnit.DAYS));
        System.out.println("周:" + LocalDateTimeUtils.betweenTwoTime(start, end, ChronoUnit.WEEKS));
        System.out.println("小时:" + LocalDateTimeUtils.betweenTwoTime(start, end, ChronoUnit.HOURS));
        System.out.println("分钟:" + LocalDateTimeUtils.betweenTwoTime(start, end, ChronoUnit.MINUTES));
        System.out.println("秒:" + LocalDateTimeUtils.betweenTwoTime(start, end, ChronoUnit.SECONDS));
        System.out.println("毫秒:" + LocalDateTimeUtils.betweenTwoTime(start, end, ChronoUnit.MILLIS));
	}

}
